package com.biz.primus.management.tms.feign;

import com.biz.primus.common.vo.SpringPageVO;
import com.biz.primus.model.tms.enums.DeliveryPriority;
import com.biz.primus.model.tms.vo.DeliveryFeeVo;
import com.biz.primus.model.tms.vo.DeliverySearchReqVo;
import com.biz.primus.model.tms.vo.DeliverySearchRespVo;
import com.biz.primus.model.tms.vo.LongitudeAndLatitudeVo;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * DeliveryOrderFeignClient
 *
 * @author JKLiues
 * @date 2017年11月27日
 */
@FeignClient(qualifier = "deliveryOrderFeignClient", name = "service-tms")
public interface DeliveryOrderFeignClient {


    /**
     * 获取配送费用
     *
     * @param priority 配送优先级
     * @return DeliveryFeeVo
     */
    @GetMapping("soa/deliveryService/getDeliverFee")
    DeliveryFeeVo getDeliverFee(@ApiParam("配送优先级") @RequestParam("priority") DeliveryPriority priority);

    /**
     * 添加,修改对应价格
     *
     * @param reqVo 更新请求
     */
    @PostMapping("soa/deliveryService/updatePrice")
    void update(@RequestBody DeliveryFeeVo reqVo);

    /**
     * 删除配送费配置
     *
     * @param id 配送费配置ID
     */
    @PostMapping("soa/deliveryService/deletePrice")
    void delete(@ApiParam("配送费配置ID") @RequestParam("id") Long id);

    /**
     * 根据id查询对应配送价格数据
     *
     * @param id 配送费配置Id
     * @return DeliveryFeeVo
     */
    @GetMapping("soa/deliveryService/findPrice")
    DeliveryFeeVo findPrice(@ApiParam("配送费配置ID") @RequestParam("id") Long id);

    /**
     * 获取配送单列表
     *
     * @param reqVo 搜索对象
     * @return SpringPageVO
     */
    @PostMapping("soa/deliveryService/searchPageDelivery")
    SpringPageVO<DeliverySearchRespVo> searchPageDelivery(@RequestBody DeliverySearchReqVo reqVo);

    /**
     * 轨迹
     * @param entityName
     * @param startDate
     * @param endDate
     * @return
     */
    @GetMapping("soa/deliveryService/getMaps")
    List<LongitudeAndLatitudeVo> getMaps(@RequestParam("entityName")String entityName, @RequestParam("startDate")String startDate, @RequestParam("endDate")String endDate);
}